package com.ficus.road.maintain.service;

import com.ficus.road.maintain.core.model.RoadInfo;
import com.ficus.road.maintain.dao.RoadInfoDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xiawen yang
 * @date 2022/4/26 下午8:26
 */
@Service
public class RoadInfoService {
    @Autowired
    private RoadInfoDao roadInfoDao;

    public List<RoadInfo> findRoadInfoWithUnit() {
        return roadInfoDao.findByQuery(new Query(Criteria.where("unit_id").ne(null)));
    }
}
